﻿using System;
using System.Collections.Generic;
using System.IO;

namespace Syno.Core.Output.OutputFormat
{
    public class HtmlFileOutput : FormatOutputBase , IOutput
    {
        private readonly string _outputFile;

        public HtmlFileOutput(string outputFile)
        {
            _outputFile = outputFile;
        }

        public string Template { get; set; }

        public string OutputFile
        {
            get { return _outputFile; }
        }

        public override void Process()
        {
            if (File.Exists(_outputFile)) File.Delete(_outputFile);
            File.WriteAllText(_outputFile, Templater.ToString(Template));
        }
    }
}